﻿using AudioMonito;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AudioMonitor
{
    internal class AudioConverterManager
    {
        List<MulticastAudioConverter> converters = new List<MulticastAudioConverter>();

        public void Start(ConfigInfo config)
        {
            Task.Run(() =>
            {
                List<string> ErrorMessage = new List<string>();
                foreach (var convertInfo in config.ConverterInfos)
                {
                    var converter = new MulticastAudioConverter(convertInfo);
                    if (!converter.StartConversion(out string msg))
                    {
                        ErrorMessage.Add(msg);
                    }
                    converters.Add(converter);
                    Thread.Sleep(1000);
                }
            });
        }
    }
}
